<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/


Route::group(['middleware'=>['mylimit','throttle:10,1']],function (){
    Route::get('/', function () {
        return view('welcome');
    });

});

Route::get('db','DbController@db')->name('db');

// 路由分组之 路由前缀 访问时前面需要添加前缀
Route::group(['prefix'=>'user'],function(){
    // 列表显示
    Route::get('index','MemberController@index')->name('user/index');

    // 添加
    // 多路由请求
    Route::match(['get','post'],'create','MemberController@create')->name('user/create');

    // 修改
    Route::get('edit/{id}','MemberController@edit')->name('user/edit');
    Route::put('edit/{id}','MemberController@update')->name('user/edit');

    // 删除
    Route::delete('del/{id}','MemberController@delete')->name('user/del');
});

